home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9777 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: halon.vggas.com!news
  2. From: JYoungman@vggas.com (James Youngman)
  3. Newsgroups: comp.os.linux.misc,comp.lang.c
  4. Subject: Re: Two things, RedHat + Linux efficiency
  5. Date: 13 Mar 1996 10:41:41 GMT
  6. Organization: VG Gas Analysis Systems
  7. Message-ID: <4i68p5$hlc@halon.vggas.com>
  8. References: <4lFXuqq00aw=M=iUNp@andrew.cmu.edu> <4i5lev$fd3@agate.berkeley.edu>
  9. NNTP-Posting-Host: 132.147.163.4
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14. In article <4i5lev$fd3@agate.berkeley.edu>, nickkral@america.CS.Berkeley.EDU 
  15. says...
  16. >
  17. >In article <4lFXuqq00aw=M=iUNp@andrew.cmu.edu>,
  18. >Nicholas P Konidaris  <npk+@andrew.cmu.edu> wrote:
  19. >>for (cnt = 0; cnt < 50000; cnt++)
  20. >>       x = x + 1
  21. >Note 2:  If you were to run "gcc -O2 blah...", that should reduce the
  22. >loop to:
  23. >
  24. >    cnt = 50000;
  25. >    x = 50000;
  26.  
  27. This turns out not to be the case in the example of GCC since it specifically
  28. recogniises this construct as a timing loop and therefore doesn't optimise
  29. it away.  Neat, eh?
  30.  
  31. James Youngman
  32.  
  33.